Transfer of Knowledge Through Ontological Relationships

Author: Charles Tapley Hoyt

Estimated Run Time: 5 seconds

This notebook shows how ontological relationships, such as chemical families and enzyme classes, can be used to make inferences in knowledge assemblies using the infer_child_relations mutations function.

Imports


In [1]:
import time
import sys
import random

from pybel.utils import get_version
from pybel.struct.mutation import infer_child_relations
from pybel_tools.visualization import *
from pybel.examples.statin_example import statin_graph, hmgcr_inhibitor, hmgcr, ec_11134

Environment


In [2]:
print(time.asctime())


Sat Feb 10 14:42:36 2018

In [3]:
print(sys.version)


3.6.4 (default, Jan  6 2018, 11:51:59) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

In [4]:
# Set seed for visualization
random.seed(127)

Dependencies


In [5]:
print(get_version())


0.11.1-dev

Example Graph

This notebook uses a small example related to statins and their target, HMG-CoA_reductase. While it is not exhaustively importing relationships using Bio2BEL ExPASy and Bio2BEL ChEBI, it still provides an atomic example on how in- and out-edges can be inferred through hierarchies.


In [6]:
to_jupyter(statin_graph)


Out[6]:

Propogation on Chemical Hierarchy

The first transformation made is to assert that all things true for EC 1.1.1.34/EC 1.1.88 inhibitors are also true for their descendants. There are two relationships showing decrease in the activities of the corresponding enzyme nodes that will be asserted for its two children, statin and mevinolinic acid, as well as recursively for their descendants.


In [7]:
infer_child_relations(statin_graph, hmgcr_inhibitor)
to_jupyter(statin_graph)


Out[7]:

Propogation on Protein Hierarchy

While EC 1.1.1.34 has several proteins across many species annotated in ExPASy, HMGCR is normalized to its HGNC nomenclature and used as the only example in this graph. Since HMGCR is an EC 1.1.1.34, all of the relationships with this enzyme node are transferred below.


In [8]:
infer_child_relations(statin_graph, ec_11134)
to_jupyter(statin_graph)


Out[8]:

Discussion

The simple interface provided by the infer_child_relations function allows for graphs to be completed.

Another possibility is to propogate relationships the other direction through hierarchies. Sometimes, it might be reasonable to guess that a property of an invididual might be true for its parent as well, and then even also true for its siblings.